package com.example.ioccontainer.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;

@Configuration
@ComponentScan("com.example.ioccontainer")
@EnableScheduling
public class AppConfig {

    @Bean
    public ExecutorService threadPoolExecutor() {
        // 创建一个固定大小的线程池
        return Executors.newFixedThreadPool(5);
    }
}
